package rmiClient;

import java.net.MalformedURLException;
import java.rmi.Naming;
import java.rmi.NotBoundException;
import java.rmi.RemoteException;

import bl.service.*;

public class Client {
	AccountService as;
	CommentService cs;
	FtPrintsService fps;
	JournalService js;
	PlanService ps;
	RecommendService rs;
	SearchSpotService sss;
	SearchUserService sus;

	String str = "rmi://127.0.0.1:1099/";
	TransmitFile tf;

	public Client() {
		try {

			as = (AccountService) Naming.lookup(str + "AccountService");
			cs = (CommentService) Naming.lookup(str + "CommentService");
			fps = (FtPrintsService) Naming.lookup(str + "FtPrintsService");
			js = (JournalService) Naming.lookup(str + "JournalService");
			ps = (PlanService) Naming.lookup(str + "PlanService");
			rs = (RecommendService) Naming.lookup(str + "RecommendService");
			sss = (SearchSpotService) Naming.lookup(str + "SearchSpotService");
			sus = (SearchUserService) Naming.lookup(str + "SearchUserService");
			tf = (TransmitFile) Naming.lookup(str + "TransmitFile");
		} catch (RemoteException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (MalformedURLException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NotBoundException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}

	public TransmitFile getTransmitFile() {
		return tf;
	}

	public AccountService getAccountService() {
		return as;
	}

	public CommentService getCommentService() {
		return cs;
	}

	public FtPrintsService getFtPrintsService() {
		return fps;
	}

	public JournalService getJournalService() {
		return js;
	}

	public PlanService getPlanService() {
		return ps;
	}

	public RecommendService getRecommendService() {
		return rs;
	}

	public SearchSpotService getSearchSpotService() {
		return sss;
	}

	public SearchUserService getSearchUserService() {
		return sus;
	}

}
